package org.jeecg.modules.online.cgform.converter.p011b;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import org.jeecg.common.system.api.ISysBaseAPI;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.SqlInjectionUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.online.cgform.consts.ExtendJsonKey;
import org.jeecg.modules.online.cgform.converter.p010a.ForeseeConvert;
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
import org.jeecg.modules.online.cgform.utils.CgformUtil;

/* renamed from: org.jeecg.modules.online.cgform.converter.b.l */
/* loaded from: hibernate-re-3.7.1-RC.jar:org/jeecg/modules/online/cgform/converter/b/l.class */
public class UserSelectConverter extends ForeseeConvert {
    public UserSelectConverter(OnlCgformField onlCgformField) {
        ISysBaseAPI iSysBaseAPI = (ISysBaseAPI) SpringContextUtils.getBean(ISysBaseAPI.class);
        String str = CgformUtil.f251W;
        String str2 = CgformUtil.f252X;
        String fieldExtendJson = onlCgformField.getFieldExtendJson();
        if (oConvertUtils.isNotEmpty(fieldExtendJson)) {
            JSONObject parseObject = JSON.parseObject(fieldExtendJson);
            if (parseObject.containsKey(ExtendJsonKey.f131d)) {
                String string = parseObject.getString(ExtendJsonKey.f131d);
                SqlInjectionUtil.filterContentMulti(new String[]{string});
                str2 = oConvertUtils.camelToUnderline(string);
            }
            if (parseObject.containsKey(ExtendJsonKey.f133f)) {
                String string2 = parseObject.getString(ExtendJsonKey.f133f);
                SqlInjectionUtil.filterContentMulti(new String[]{string2});
                str = oConvertUtils.camelToUnderline(string2);
            }
        }
        this.f175b = iSysBaseAPI.queryTableDictItemsByCode(CgformUtil.f250V, str, str2);
        this.f174a = onlCgformField.getDbFieldName();
    }

    @Override // org.jeecg.modules.online.cgform.converter.p010a.ForeseeConvert, org.jeecg.modules.online.cgform.converter.FieldCommentConverter
    public String converterToVal(String txt) {
        if (oConvertUtils.isEmpty(txt)) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (String str : txt.split(CgformUtil.f233E)) {
            String converterToVal = super.converterToVal(str);
            if (converterToVal != null) {
                arrayList.add(converterToVal);
            }
        }
        return String.join(CgformUtil.f233E, arrayList);
    }

    @Override // org.jeecg.modules.online.cgform.converter.p010a.ForeseeConvert, org.jeecg.modules.online.cgform.converter.FieldCommentConverter
    public String converterToTxt(String val) {
        if (oConvertUtils.isEmpty(val)) {
            return null;
        }
        ArrayList arrayList = new ArrayList();
        for (String str : val.split(CgformUtil.f233E)) {
            String converterToTxt = super.converterToTxt(str);
            if (converterToTxt != null) {
                arrayList.add(converterToTxt);
            }
        }
        return String.join(CgformUtil.f233E, arrayList);
    }
}
